package org.spring.learn.demo.annotation.configures.scope;

import org.spring.learn.project.entity.Person;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class MyTest {

    @Test
    public void test() {
        // Ioc 控制反转
        ApplicationContext app = new AnnotationConfigApplicationContext(MyConfig.class);

        Object bean1 = app.getBean("person");
        Object bean2 = app.getBean("person");
        System.out.println(bean1 == bean2);


        Person bean = app.getBean(Person.class);
        System.out.println(bean);
    }
}
